package com.qf.data.user.vo.input;

import com.qf.commons.standar.vaild.QfVaild;
import com.qf.data.user.vaild.RedParamsVaild;
import lombok.Data;

import javax.validation.constraints.Digits;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * 红包的相关参数
 * description:
 * author: Ken
 * 公众号：Java架构栈
 */
@Data
@QfVaild(handler = RedParamsVaild.class, message = "红包参数不匹配")
public class RedEnveInput {

    @Min(value = 0, message = "红包类型不正确")
    @Max(value = 1, message = "红包类型不正确")
    @NotNull(message = "红包类型不能为空")
    private Integer type;
    @Min(value = 1, message = "红包额度最低需要1积分")
    @Digits(integer = Integer.MAX_VALUE, fraction = 0, message = "红包积分额度数据类型异常")
    @NotNull(message = "红包积分额度不能为空")
    private Integer score;
    @Min(value = 1, message = "红包份额最低需要1份")
    @Digits(integer = Integer.MAX_VALUE, fraction = 0, message = "红包份额数据类型异常")
    @NotNull(message = "红包份额不能为空")
    private Integer count;
    private String info;
}
